<!DOCTYPE html>
<div class="accordion" th:id="'menu-' + ${parentId}" xmlns:th="http://www.thymeleaf.org">
    <div class="accordion-group" th:each="menu,menuStat:${menus}">
        <div class="accordion-heading">
            <a class="accordion-toggle"
               data-toggle="collapse"
               th:data-parent="'#menu-' + ${parentId}"
               th:data-href="'#collapse-' + ${menu.id}"
               th:href="'#collapse-' + ${menu.id}">
                <i th:class="'icon-chevron-' + ${menuStat.index==0?'down':'right'}"></i>
                &nbsp;<span th:text="${menu.name}"></span>
            </a>
        </div>

        <div th:id="'collapse-'+ ${menu.id}"
             th:class="'accordion-body collapse' + ${menuStat.index == 0?'in':''}">
            <div class="accordion-inner">
                <ul class="nav nav-list">
                    <li th:each="menu2:${menu.childMenus}">
                        <a th:href="${menu2.url}"
                           target="mainFrame">
                            <i th:class="'icon-' + ${menu2.icon!=null ? menu2.icon : 'circle-arrow-right'}"></i>
                            &nbsp;<span th:text="${menu2.name}"></span>
                        </a>
                    </li>
                </ul>
            </div>
        </div>

    </div>
</div>